#include<string>
#include<windows.h>
#include"MainIncluders.hpp"

using namespace std;

struct wtp
{
	TCHAR tchar;
	string str;
	const char* chr;
	string tchartostring(TCHAR& intput);
	const char* stringtochar(string& intput);
	void atupdt(TCHAR& tchars, string& strs, char chrs);

};

string wtp::tchartostring(TCHAR& intput)
{
	TCHAR* intputptr = &intput;
	int iLen = WideCharToMultiByte(CP_ACP, 0, intputptr, -1, NULL, 0, NULL, NULL);
	char* chRtn = new char[iLen * sizeof(char)];
	WideCharToMultiByte(CP_ACP, 0, intputptr, -1, chRtn, iLen, NULL, NULL);
	string str(chRtn);
	delete chRtn;
	return str;
}

const char* wtp::stringtochar(string& intput)
{
	const char* p = intput.c_str();
	return p;
}

void wtp::atupdt(TCHAR& tchars, string& strs, char chrs)
{
	str = tchartostring(tchar);
	chr = stringtochar(str);
}

